package com.jt.tenant.app;

import android.content.Context;

import com.zcx.helper.app.AppPreferences;

/**
 * Created by Administrator on 2016/1/30.
 */
public class JTPreferences extends AppPreferences {

    public JTPreferences(Context context) {

        super(context, "jt");

    }

//    储存用户状态，0：未绑定车辆，未绑定设备  1：已绑定车辆，未绑定设备，2：已绑定设备
    public void saveUserState(String state) {

        putString("userState", state);

    }

    public String readUserState() {

        return getString("userState", "0");

    }

    public void saveUserId(String userId) {

        putString("userId", userId);

    }

    public String readUserID() {

        return getString("userId", "");

    }

    public void saveHaveUid(boolean haveUid) {

        putBoolean("haveUid", haveUid);

    }

    public boolean readHaveUid() {

        return getBoolean("haveUid", false);

    }

    public void saveHaveObdid(boolean haveObdid) {

        putBoolean("haveObdid", haveObdid);

    }

    public boolean readHaveObdid() {

        return getBoolean("haveObdid", false);

    }

    public void saveIsGuide(boolean isGuide) {

        putBoolean("isGuide", isGuide);

    }

    public boolean readIsGuide() {

        return getBoolean("isGuide", false);

    }

    public void saveMapFirst(boolean mapfirst) {

        putBoolean("mapfirst", mapfirst);

    }

    public boolean readMapFirst() {

        return getBoolean("mapfirst", false);

    }

    public void saveMaintainFirst(boolean maintain) {

        putBoolean("maintain", maintain);

    }

    public boolean readMaintainFirst() {

        return getBoolean("maintain", false);

    }

    public void saveInsuranceFirst(boolean insurance) {

        putBoolean("insurance", insurance);

    }

    public boolean readInsuranceFirst() {

        return getBoolean("insurance", false);

    }

    public void saveOilFirst(boolean oil) {

        putBoolean("oil", oil);

    }

    public boolean readOilFirst() {

        return getBoolean("oil", false);

    }


    public void saveToken(String token) {

        putString("token", token);

    }

    public String readToken() {

        return getString("token", "");

    }

    public void saveObdId(String obdId) {

        putString("obdId", obdId);

    }

    public String readOdbID() {

        return getString("obdId", "");

    }

    public void savePhone(String phone) {

        putString("phone", phone);
    }

    public String readPhone() {

        return getString("phone", "");
    }

    public void saveNickName(String nickName) {

        putString("nickName", nickName);
    }

    public String readNickName() {

        return getString("nickName", "");
    }

    //    积分 type : 1，定向积分  2，通用积分
    public void saveUserIntegral(String integral,String type){
        putString("userIntegral"+type, integral);
    }

    public String readUserIntegral(String type) {

        return getString("userIntegral"+type, "0");

    }

    /***
     * 车牌号
     *
     * @param plateNum
     */
    public void savePlateNum(String plateNum) {

        putString("plateNum", plateNum);
    }

    public String readPlateNum() {

        return getString("plateNum", "");
    }

    /***
     * 车架号
     *
     * @param vincode
     */
    public void saveVincode(String vincode) {

        putString("vincode", vincode);
    }

    public String readVincode() {

        return getString("vincode", "");
    }

    /***
     * 设备信息-版本
     */
    public void saveEquipEdition(String equipEdition) {

        putString("equipEdition", equipEdition);
    }

    public String readEquipEdition() {

        return getString("equipEdition", "");
    }

    /***
     * 设备信息-激活状态
     */
    public void saveEquipActive(String equipActive) {

        putString("equipActive", equipActive);
    }

    public String readEquipActive() {

        return getString("equipActive", "");
    }

    /***
     * 设备信息-套餐剩余时间
     */
    public void saveEquipTime(String equipTime) {

        putString("equipTime", equipTime);
    }

    public String readEquipTime() {

        return getString("equipTime", "");
    }

    /***
     * 个人中心-头像路径的存储
     */
    public void saveHeadPath(String headPath) {

        putString("headPath", headPath);
    }

    public String readHeadPath() {

        return getString("headPath", "");
    }

    /***
     * 个人中心-紧急手机号
     */
    public void savePhone2(String phone2) {

        putString("phone2", phone2);
    }

    public String readPhone2() {

        return getString("phone2", "");
    }

    /***
     * 个人中心-驾驶证号
     */
    public void saveDriverNum(String driverNum) {

        putString("driverNum", driverNum);
    }

    public String readDriverNum() {

        return getString("driverNum", "");
    }

    /***
     * 个人中心-有效起始日期
     */
    public void saveDriverEffectiveDate(String driverEffectiveDate) {

        putString("driverEffectiveDate", driverEffectiveDate);
    }

    public String readDriverEffectiveDate() {

        return getString("driverEffectiveDate", "");
    }

    /***
     * 个人中心-有效期
     */
    public void saveDriverEffectiveYear(String driverEffectiveYear) {

        putString("driverEffectiveYear", driverEffectiveYear);
    }

    public String readDriverEffectiveYear() {

        return getString("driverEffectiveYear", "");
    }


    /**
     * 性别
     */
    public void saveSex(String sex) {

        putString("sex", sex);

    }

    public String readSex() {

        return getString("sex", "");

    }

    /**
     * 发动机号
     */
    public void saveEngineCode(String engine_code) {

        putString("engine_code", engine_code);

    }

    public String readEngineCode() {

        return getString("engine_code", "");

    }

    /**
     * 城市编号
     */
    public void saveCityCode(String city_code) {

        putString("city_code", city_code);

    }

    public String readCityCode() {

        return getString("city_code", "");

    }

    /**
     * 震动设置 First
     */
    public void saveShockIsFirst(boolean shockIsFirst) {

        putBoolean("shockIsFirst", shockIsFirst);

    }

    public boolean readShockIsFirst() {

        return getBoolean("shockIsFirst", true);

    }

    /**
     * 震动设置 数值
     */
    public void saveShockNum(int shockNum) {

        putInt("shockNum", shockNum);

    }

    public int readShockNum() {

        return getInt("shockNum", 1);

    }

    /**
     * 震动设置 On/Off
     */
    public void saveShockBool(int shockBool) {

        putInt("shockBool", shockBool);

    }

    public int readShockBool() {

        return getInt("shockBool", 0);

    }


    /**
     * 车品牌
     */
    public void savePP(String pp) {

        putString("pp", pp);

    }

    public String readPP() {

        return getString("pp", "");

    }

    /**
     * 车型名称
     */
    public void saveCategoryName(String category_ame) {

        putString("category_ame", category_ame);

    }

    public String readCategoryName() {

        return getString("category_ame", "");

    }

    /**
     * 排量
     */
    public void savePL(String pl) {

        putString("pl", pl);

    }

    public String readPL() {

        return getString("pl", "");

    }

    /**
     * 年款
     */
    public void saveNK(String nk) {

        putString("nk", nk);

    }

    public String readNK() {

        return getString("nk", "");

    }

    /**
     * 变速箱
     */
    public void saveBSX(String bsx) {

        putString("bsx", bsx);

    }

    public String readBSX() {

        return getString("bsx", "");

    }

    /**
     * 购买时间
     */
    public void saveRemark(String remark) {

        putString("remark", remark);

    }

    public String readRemark() {

        return getString("remark", "");

    }

    /**
     * 城市
     */
    public void saveCity(String city) {

        putString("city", city);

    }

    public String readCity() {

        return getString("city", "");

    }

    /**
     * 经度
     */
    public void saveLat(String lat) {

        putString("lat", lat);

    }

    public String readLat() {

        return getString("lat", "");

    }

    /**
     * 纬度
     */
    public void saveLng(String lng) {

        putString("lng", lng);

    }

    public String readLng() {

        return getString("lng", "");

    }

    /**
     * 创建时间
     */
    public void saveCreatetime(String createtime) {

        putString("createtime", createtime);

    }

    public String readCreatetime() {

        return getString("createtime", "");

    }

    /**
     * 更新时间
     */
    public void saveUpdatetime(String updatetime) {

        putString("updatetime", updatetime);

    }

    public String readUpdatetime() {

        return getString("updatetime", "");

    }

    /**
     * 车型id
     */
    public void saveCategoryId(String categoryId) {

        putString("categoryId", categoryId);

    }

    public String readCategoryId() {

        return getString("categoryId", "");

    }

    /**
     * 车的归属类型
     */
    public void saveCarType(String carType) {

        putString("carType", carType);

    }

    public String readCarType() {

        return getString("carType", "");

    }

    /**
     * 是否查询过
     */
    public void saveIsQuery(String isQuery) {

        putString("isQuery", isQuery);

    }

    public String readIsQuery() {

        return getString("isQuery", "");

    }

    /**
     * 厂家cj
     */
    public void saveCJ(String cj) {

        putString("cj", cj);

    }

    public String readCJ() {

        return getString("cj", "");

    }

    /**
     * 车的id
     */
    public void saveCarId(String carid) {

        putString("carid", carid);

    }

    public String readCarId() {

        return getString("carid", "");

    }

    /**
     * 电瓶购买时间
     */
    public void saveBatteryTime(String batteryTime) {

        putString("batteryTime", batteryTime);

    }

    public String readBatteryTime() {

        return getString("batteryTime", "");

    }

    /**
     * 配置
     */

    public void savePZ(String pz) {

        putString("pz", pz);

    }

    public String readPZ() {

        return getString("pz", "");

    }

    /**
     * 消息设置
     */

    public void saveMessage(boolean msg,String type) {

        putBoolean("msg" + type, msg);
    }

    public boolean readMessage(String type) {

        return getBoolean("msg" + type, false);
    }

    //行车报告提醒
    public void saveMessage1(boolean msg) {

        putBoolean("msg", msg);
    }

    public boolean readMessage1() {

        return getBoolean("msg", false);
    }



    //电子围栏提醒
    public void saveDZWLMessage(boolean dzwl) {

        putBoolean("dzwl", dzwl);
    }

    public boolean readDZWLMessage() {

        return getBoolean("dzwl", false);
    }

    //电瓶状态提醒
    public void saveDPZTMessage(boolean dpzt) {

        putBoolean("dpzt", dpzt);
    }

    public boolean readDPZTMessage() {

        return getBoolean("dpzt", false);
    }

    //违章提醒
    public void saveWZTXMessage(boolean wztx) {

        putBoolean("wztx", wztx);
    }

    public boolean readWZTXMessage() {

        return getBoolean("wztx", false);
    }

    //异常震动提醒
    public void saveYCZDMessage(boolean yczd) {

        putBoolean("yczd", yczd);
    }

    public boolean readYCZDMessage() {

        return getBoolean("yczd", false);
    }

    //保养提醒
    public void saveBYTXMessage(boolean bttx) {

        putBoolean("bttx", bttx);
    }

    public boolean readBYTXMessage() {

        return getBoolean("bttx", false);
    }

    //上次检测时间
    public void saveScoreDate(String scoreDate) {

        putString("scoreDate", scoreDate);
    }

    public String readScoreDate() {

        return getString("scoreDate", "");

    }

    //检测分数
    public void saveScore(String score) {

        putString("score", score);
    }

    public String readScore() {

        return getString("score", "");

    }

    //登录帐号
    public void saveLoginUser(String loginUser) {

        putString("loginUser", loginUser);
    }

    public String readLoginUser() {

        return getString("loginUser", "");

    }

    //登录密码
    public void saveLoginPwd(String loginPwd) {

        putString("loginPwd", loginPwd);
    }

    public String readLoginPwd() {

        return getString("loginPwd", "");

    }

    public void saveCX(String cx) {

        putString("cx", cx);
    }

    public String readCX() {

        return getString("cx", "");

    }

    //WIFI开关
    public void saveWIFI(String wifi) {

        putString("wifi", wifi);
    }

    public String readWIFI() {

        return getString("wifi", "");

    }

    //WIFI密码
    public void saveWIFIPWD(String wifipwd) {

        putString("wifipwd", wifipwd);
    }

    public String readWIFIPWD() {

        return getString("wifipwd", "");

    }

    /**
     * 隐私保护
     */
    public void savePrivacy(boolean privacy) {

        putBoolean("privacy", privacy);

    }

    public boolean readPrivacy() {

        return getBoolean("privacy", false);

    }

    public void saveFreeway(String freeway) {

        putString("freeway", freeway);

    }

    public String readFreeway() {

        return getString("freeway","0");

    }

    //保险状态
    public void saveInsFlag(String flag) {

        putString("insFlag", flag);

    }

    public String readInsFlag() {

        return getString("insFlag", "0");

    }


    //账号状态   0：未添加车辆，未绑定设备  1：已添加车辆，未绑定设备  2：已绑定设备
    public void saveAccountState(String flag) {

        putString("accountState", flag);

    }

    public String readAccountState() {

        return getString("accountState", "2");

    }
}
